package org.groovyflow.util.view;

/**
 * Typically used to write an alternating stream of odd/even css classes.
 * @author Chuck Tassoni
 *
 */

public class OddEven {
	private int num = 1;
	public String pick(){
		int decision = num % 2;
		String answer =  decision > 0 ? "odd" : "even";
		num++;
		return answer;
	}
	
	public void reset(){
		this.num = 1;
	}

	
	public static void main(String[] args){
		OddEven x = new OddEven();
		for(int i = 0; i < 11; i++){
			System.out.println(x.pick());
		}
		
		System.out.println("**************resetting");
		x.reset();
		for(int i = 0; i < 11; i++){
			System.out.println(x.pick());
		}		

	}
	
}
